Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward models of prisms gravity fields with Choclo #400

Merged
merged 26 commits into from
May 25, 2023
Merged

Conversation

santisoler
Copy link
Member

@santisoler santisoler commented Apr 17, 2023

Replace the prisms gravity kernels for Choclo functions. Extend the capabilities of the prism_gravity function allowing to compute all the gravitational acceleration and tensor components. Add tests that compare Harmonica results against dumb Choclo calls and a Laplacian equation test for the diagonal components of the tensor. Ditch symmetry tests that were already covered by Choclo. Improve docstrings. Raise warning if any computation point falls in a singular point for the tensor components. Add tests for these new checks and warnings.

Add Choclo as a required dependency of Harmonica and replace the current
kernels for prisms gravity with the ones in Choclo.
Allow the `prism_gravity` function to compute the easting and northing
components of the gravitational acceleration of prisms, using Choclo
kernels for it. Add tests that compare with bare Choclo results. Remove
the dispatcher and replace it with and `if`/`else` statement for
selecting the parallelized or serialized jitted function.
Add tests against dumb Choclo calls and a Laplace equation test for the
diagonal tensor components. Improve the warning on the docstring
explaining the direction of `z`.
The tests in Choclo already cover those and they are more extensive.
Check if the gravity tensor components of a prism are being computed at
any singular point. Choclo will return a ``np.nan`` on those points, but
it's worth warning the user about it before they get the results.
Add tests that check if the warnings are being raised on those cases.
Update the expected values after we updated the gravitational constant
in Choclo.
Modify the test function that compares prism forward model with the
analytic solution for an infinite slab: locate the observation point on
top of the slab.
Rename forward_func variable to avoid confusion with the forward_func
argument of the jit functions.
Move some details to a new Notes section, improve some definition of the
parameters, improve the warning regarding the upward direction, add
a References section.
@santisoler santisoler marked this pull request as ready for review May 17, 2023 22:56
Redesign the checker for singular points to make it simpler and fix the
issue with Numba that made some tests to fail.
Copy link
Member

@LL-Geo LL-Geo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks great @santisoler 👍

harmonica/_forward/prism.py Outdated Show resolved Hide resolved
santisoler and others added 3 commits May 23, 2023 09:38
Co-authored-by: Lu Li <[email protected]>
Run checks for singular points using Numba jitted functions to speed up
the for loops.
@santisoler
Copy link
Member Author

Thanks @LL-Geo! I just pushed a few fixes. We can ignore codecov failing: we have less code now, since was moved to Choclo, so codecov sees that we are running less coverage percentage, but we are actually testing everything we want to test. I'm merging this!

Add a section to the prism forward modelling page in the user guide
showing how we can compute all gravitational acceleration and tensor
components of a single prism.
@santisoler santisoler merged commit d3c2c8b into main May 25, 2023
@santisoler santisoler deleted the prisms-choclo branch May 25, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants